#define _CRT_SECURE_NO_WARNINGS 1
/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
int maxDepth(struct TreeNode* root)
{
    if (root == NULL)
    {
        return 0;
    }
    int leftdep = maxDepth(root->left);
    int rightdep = maxDepth(root->right);
    if (leftdep > rightdep)
    {
        return leftdep + 1;
    }
    else
    {
        return rightdep + 1;
    }
}